package lab02.test28;

import java.util.InputMismatchException;
import java.util.Scanner;

public class Test28 {
    public static void main(String[] args) {

        double radius = 0,area = 0;

        Scanner scanner = new Scanner(System.in);

        try {
            System.out.print("请输入圆的半径：");
            radius = scanner.nextDouble();
            area = 3.14 * radius * radius;
            System.out.println("面积为：" + area);
        }catch(InputMismatchException e) {
            System.out.println("输入的字符非法！");
        }finally{

        }
    }
}
